package com.makeblock.demo.testdatabinding.main;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.makeblock.demo.testdatabinding.model.DataModel;
import com.makeblock.demo.testdatabinding.R;
import com.makeblock.demo.testdatabinding.databinding.ActivityMainBinding;
import com.makeblock.demo.testdatabinding.viewmodel.MainViewModel;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        DataModel dataModel = new DataModel("点右边", false, "hide text");
        MainViewModel mainViewModel = new MainViewModel(dataModel);
        binding.setViewModel(mainViewModel);
    }
}
